package com.wt.springsamples.annotation;

import io.swagger.annotations.ApiOperation;
import org.springframework.core.annotation.AliasFor;
import org.springframework.security.access.prepost.PreAuthorize;

import java.lang.annotation.*;

@Target({ ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@PreAuthorize("hasAuthority('API:DEFAULT')")
//@PreAuthorize("")
@ApiOperation("default")
public @interface AccessControl{

    @AliasFor(annotation = PreAuthorize.class)
    String value() default "";

    @AliasFor(annotation = ApiOperation.class,attribute = "nickname")
    String name() default "";

    @AliasFor(annotation = ApiOperation.class,attribute = "value")
    String code() default "";
}
